# -*- coding:utf-8 -*-

import os
import sys

from tornado import web, ioloop, httpserver
from util import init_log, get_logger

from tornado_mysql import pools
from handle import LoginHandle,RegisterHandler

init_log(sys.stdout)

log = get_logger(__name__)


def make_app():

    return web.Application([
        (r"/login", LoginHandle),
        (r"/register", RegisterHandler),
    ])


if __name__ == "__main__":

    app = make_app()

    server = httpserver.HTTPServer(app)
    server.bind(8000)
    server.start(0)
    ioloop.IOLoop.current().start()
    ioloop.IOLoop.instance()
